<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    //实例
    //转换成number类型
    var a='123.456img';
    var a1=parseInt(a);
    var a2=parseFloat(a);
    document.write("a1="+a1+'<br/>'+"a2="+a2+'<br/>');
    document.write(typeof a2+'<br/>');

    //转换成string类型
    var b =3.1415926;
    var b1=b+"";
    document.write(typeof(b1)+'<br/>');

    //转换成Boolean类型
    var c='img'+3+'.jpg';
    var c1=!!c;
    document.write('c1='+c1);
    alert(typeof c1);
</script>
</html>